package com.example.demo.service.aplication;

import com.example.demo.entity.User;
import com.example.demo.entity.UserCopy;
import com.example.demo.mapper.user.UserCopyMapper;
import com.example.demo.mapper.user.UserDao;
import com.example.demo.util.AsyncUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("userCopyServiceOneImpl")
public class UserCopyServiceOneImpl  implements UserCopyService {

    Logger logger = LoggerFactory.getLogger(UserCopyServiceOneImpl.class);

    @Autowired
    private UserDao userDao;

    @Autowired
    private AsyncUtils asyncUtils;

    @Autowired
    private UserCopyMapper userCopyMapper;


    public List<User> getUserList() {
        UserCopy userCopy = userCopyMapper.selectByPrimaryKey(1L);
        logger.info(userCopy.toString());
        //执行异步方法
        asyncUtils.getAsync();
        return userDao.getUserList();
    }


}
